/**
 * @copyright 2017 Indie Semiconductor.
 *
 * This file is proprietary to Indie Semiconductor.
 * All rights reserved. Reproduction or distribution, in whole
 * or in part, is forbidden except by express written permission
 * of Indie Semiconductor.
 *
 * @file ledParamTables.c
 * @Author: Jack.Pan
 * @E-mail:jack.pan@indiemicro.com
 * @Date: 2020/09/10
 */

#include <ledParamTables.h>
/* Multi DomiLED D6RTB-HKG-CS1124 (O) */
/* Efficiency is 1024 @25C , the value is 990*1024/1000 when efficiency is 99.0% */ 
static const TempParams_t TEMP_CURVE_TABLE_RED[TEMP_CMP_NUM_MAX] = 
{
    /*T(1C) efficiency deltaV(mV) x(%), y(%) */
    {/*0,*/   1174U, 41 , 1020U,1035U},
    {/*2,*/   1165U, 35 , 1021U,1033U},
    {/*4,*/   1156U, 30 , 1021U,1032U},
    {/*6,*/   1147U, 26 , 1021U,1031U},
    {/*8,*/   1138U, 22 , 1022U,1029U},
    {/*10,*/  1107U, 20 , 1022U,1028U},
    {/*12,*/  1096U, 15 , 1022U,1027U},
	
    {/*14,*/  1086U, 13 , 1023U,1027U},
    {/*16,*/  1075U, 12 , 1023U,1026U},
    {/*18,*/  1065U, 9  , 1024U,1026U},
    {/*20,*/  1054U, 6 ,  1024U,1025U},
    {/*22,*/  1039U, 3 ,  1024U,1025U},
	
    {/*24,*/  1024U, 0 ,  1024U,1024U},	
    {/*26,*/  1012U, -3 , 1023U,1023U},
    {/*28,*/  999U,  -6,  1025U,1022U},
    {/*30,*/  987U,  -9,  1025U,1021U},
    {/*32,*/  975U,  -12, 1025U,1020U},
	
    {/*34,*/  963U,  -16, 1026U,1020U},
    {/*36,*/  950U,  -19, 1026U,1019U},
    {/*38,*/  938U,  -22, 1027U,1019U},
    {/*40,*/  926U,  -25, 1027U,1018U},
    {/*42,*/  909U,  -28, 1027U,1017U},
	
    {/*44,*/  892U,  -31, 1027U,1016U},
    {/*46,*/  874U,  -34, 1028U,1016U},
    {/*48,*/  857U,  -36, 1028U,1015U},
    {/*50,*/  840U,  -38, 1028U,1014U},
    {/*52,*/  827U,  -40, 1028U,1013U},
	
    {/*54,*/  815U,  -43, 1029U,1013U},
    {/*56,*/  802U,  -45, 1029U,1012U},
    {/*58,*/  790U,  -48, 1030U,1012U},
    {/*60,*/  777U,  -50, 1030U,1011U},
    {/*62,*/  762U,  -54, 1030U,1010U},
	
    {/*64,*/  748U,  -56, 1030U,1010U},
    {/*66,*/  733U,  -62, 1031U,1009U},
    {/*68,*/  719U,  -67, 1031U,1009U},
    {/*70,*/  704U,  -69, 1031U,1008U},
    {/*72,*/  698U,  -73, 1031U,1007U},
	
    {/*74,*/  674U,  -75, 1031U,1007U},
    {/*76,*/  658U,  -79, 1032U,1006U},
    {/*78,*/  643U,  -81, 1032U,1006U},
    {/*80,*/  628U,  -84, 1032U,1005U},  
    {/*82,*/  616U,  -87, 1032U,1005U},
	
    {/*84,*/  602U,  -89, 1033U,1004U},
    {/*86,*/  588U,  -91, 1033U,1004U},
    {/*88,*/  574U,  -93, 1033U,1003U},
    {/*90,*/  560U,  -96, 1033U,1003U},
    {/*92,*/  545U,  -99, 1033U,1002U},
	
    {/*94,*/  531U,  -102, 1034U,1002U},
    {/*96,*/  517U,  -105, 1034U,1001U},
    {/*98,*/  503U,  -107, 1034U,1001U},
    {/*100,*/ 488U,  -111, 1034U,1000U},
    {/*102,*/ 474U,  -113, 1035U,999U},
	
    {/*104,*/ 460U,  -118, 1035U,999U},
    {/*106,*/ 446U,  -119, 1035U,999U},
    {/*108,*/ 432U,  -123, 1035U,998U},
    {/*110,*/ 417U,  -126, 1035U,997U},
    {/*112,*/ 403U,  -130, 1036U,997U},
	
    {/*114,*/ 389U,  -133, 1036U,996U},
    {/*116,*/ 375U,  -136, 1036U,996U},
    {/*118,*/ 360U,  -138, 1036U,995U},
    {/*120,*/ 346U,  -141, 1037U,995U},
};

static const TempParams_t TEMP_CURVE_TABLE_GREEN[TEMP_CMP_NUM_MAX] = 
{
    /*T(1C) efficiency deltaV(mV) x(%), y(%) */
    {/*0,  */ 1052U, 28  ,977U,1030U},
    {/*2,  */ 1048U, 26  ,982U,1030U},
    {/*4,  */ 1044U, 24  ,987U,1030U},
    {/*6,  */ 1040U, 21  ,992U,1028U},
    {/*8,  */ 1036U, 19  ,997U,1028U},
    {/*10, */ 1032U, 16  ,1002U,1027U},
    {/*12, */ 1031U, 14  ,1005U,1027U},
	
    {/*14, */ 1030U, 12  ,1008U,1026U},
    {/*16, */ 1030U, 10  ,1012U,1026U},
    {/*18, */ 1029U, 8   ,1015U,1025U},
    {/*20, */ 1028U, 5   ,1018U,1025U},
    {/*22, */ 1026U, 2   ,1021U,1025U},
	
    {/*24, */ 1024U, 0   ,1024U,1024U},
    {/*26, */ 1023U,  -2 ,1028U,1023U},
    {/*28, */ 1021U,  -5 ,1032U,1023U},
    {/*30, */ 1020U,  -7 ,1036U,1022U},
    {/*32, */ 1019U,  -9 ,1040U,1022U},
	
    {/*34, */ 1018U,  -12,1043U,1021U},
    {/*36, */ 1017U,  -16,1047U,1021U},
    {/*38, */ 1016U,  -18,1050U,1020U},
    {/*40, */ 1015U,  -21,1054U,1020U},
    {/*42, */ 1014U,  -22,1059U,1019U},
	
    {/*44, */ 1013U,  -24,1064U,1018U},
    {/*46, */ 1011U,  -25,1068U,1018U},
    {/*48, */ 1010U,  -27,1073U,1017U},
    {/*50, */ 1009U,  -29,1078U,1016U},
    {/*52, */ 1008U,  -30,1081U,1016U},
	
    {/*54, */ 1007U,  -33,1085U,1015U},
    {/*56, */ 1005U,  -35,1088U,1015U},
    {/*58, */ 1004U,  -37,1092U,1014U},
    {/*60, */ 1003U,  -39,1095U,1014U},
    {/*62, */ 1002U,  -43,1099U,1013U},
	
    {/*64, */ 1000U, -44,1103U,1013U},
    {/*66, */ 999U,  -45,1106U,1012U},
    {/*68, */ 997U,  -47,1110U,1012U},
    {/*70, */ 996U,  -50,1114U,1011U},
    {/*72, */ 994U,  -52,1118U,1010U},
	
    {/*74, */ 993U,  -55,1122U,1009U},
    {/*76, */ 991U,  -57,1126U,1009U},
    {/*78, */ 990U,  -58,1130U,1008U},
    {/*80, */ 988U,  -61,1134U,1007U},
    {/*82, */ 987U,  -63,1138U,1007U},
	
    {/*84, */ 985U,  -65,1142U,1006U},
    {/*86, */ 984U,  -67,1147U,1005U},
    {/*88, */ 982U,  -69,1151U,1005U},
    {/*90, */ 981U,  -71,1155U,1004U},
    {/*92, */ 980U,  -73,1160U,1003U},
	
    {/*94, */ 978U,  -74,1164U,1002U},
    {/*96, */ 977U,  -76,1169U,1002U},
    {/*98, */ 975U,  -77,1173U,1001U},
    {/*100,*/ 974U,  -79,1178U,1000U},
    {/*102,*/ 973U,  -81,1183U,999U},
	
    {/*104,*/ 971U,  -83,1187U,998U},
    {/*106,*/ 970U,  -84,1192U,998U},
    {/*108,*/ 968U,  -86,1197U,997U},
    {/*110,*/ 967U,  -88,1202U,996U},
    {/*112,*/ 966U,  -89,1207U,995U},
	
    {/*114,*/ 964U,  -91,1212U,994U},
    {/*116,*/ 963U,  -92,1217U,993U},
    {/*118,*/ 961U,  -94,1222U,992U},
    {/*120,*/ 960U,  -96,1227U,991U},
};

static const TempParams_t TEMP_CURVE_TABLE_BLUE[TEMP_CMP_NUM_MAX] = 
{
    /*T(1C) efficiency deltaV(mV) x(%), y(%) */
    {/*0,  */ 991U,  21  ,1032U,963U},
    {/*2,  */ 994U,  20  ,1031U,970U},
    {/*4,  */ 997U,  18  ,1030U,978U},
    {/*6,  */ 1000U,  16  ,1029U,986U},
    {/*8,  */ 1003U,  15  ,1028U,993U},
    {/*10, */ 1006U,  13  ,1027U,1004U},
    {/*12, */ 1008U,  12  ,1027U,1004U},
	
    {/*14, */ 1010U,  9  ,1026U,1006U},
    {/*16, */ 1011U,  7  ,1026U,1009U},
    {/*18, */ 1013U, 6   ,1025U,1011U},
    {/*20, */ 1015U, 4   ,1025U,1014U},
    {/*22, */ 1019U, 2   ,1025U,1019U},
	
    {/*24, */ 1024U, 0   ,1024U,1024U},
    {/*26, */ 1028U, -2  ,1023U,1028U},
    {/*28, */ 1031U, -4  ,1022U,1031U},
    {/*30, */ 1035U, -6  ,1021U,1035U},
    {/*32, */ 1038U, -8 ,1020U,1038U},
	
    {/*34, */ 1041U, -10 ,1020U,1042U},
    {/*36, */ 1044U, -12 ,1019U,1045U},
    {/*38, */ 1047U, -14 ,1019U,1049U},
    {/*40, */ 1050U, -16 ,1018U,1052U},
    {/*42, */ 1054U, -18 ,1017U,1058U},
	
    {/*44, */ 1058U, -20 ,1016U,1064U},
    {/*46, */ 1062U, -22 ,1015U,1070U},
    {/*48, */ 1066U, -24 ,1014U,1076U},
    {/*50, */ 1070U, -25 ,1013U,1082U},
    {/*52, */ 1073U, -27 ,1012U,1087U},
	
    {/*54, */ 1077U, -29 ,1012U,1091U},
    {/*56, */ 1080U, -31 ,1011U,1096U},
    {/*58, */ 1084U, -32 ,1011U,1100U},
    {/*60, */ 1087U, -33 ,1010U,1105U},
    {/*62, */ 1090U, -34 ,1009U,1110U},
	
    {/*64, */ 1094U, -36 ,1009U,1115U},
    {/*66, */ 1097U, -37 ,1008U,1120U},
    {/*68, */ 1101U, -39 ,1008U,1125U},
    {/*70, */ 1104U, -41 ,1007U,1130U},
    {/*72, */ 1107U, -43 ,1006U,1136U},
	
    {/*74, */ 1110U, -45 ,1006U,1141U},
    {/*76, */ 1114U, -47 ,1005U,1147U},
    {/*78, */ 1117U, -48 ,1005U,1152U},
    {/*80, */ 1120U, -51 ,1004U,1158U},
    {/*82, */ 1124U, -53 ,1003U,1164U},
	
    {/*84, */ 1127U, -56 ,1002U,1169U},
    {/*86, */ 1131U, -60 ,1001U,1176U},
    {/*88, */ 1134U, -61 ,1001U,1182U},
    {/*90, */ 1138U, -64 ,1000U,1188U},
    {/*92, */ 1141U, -66 ,999U,1194U},
	
    {/*94, */ 1144U, -68 ,999U,1201U},
    {/*96, */ 1148U, -70 ,998U,1207U},
    {/*98, */ 1151U, -72 ,997U,1214U},
    {/*100,*/ 1154U, -73 ,996U,1221U},
    {/*102,*/ 1158U, -76 ,996U,1228U},
	
    {/*104,*/ 1161U, -78 ,995U,1234U},
    {/*106,*/ 1165U, -80 ,994U,1242U},
    {/*108,*/ 1168U, -81 ,993U,1249U},
    {/*110,*/ 1171U, -83 ,993U,1256U},
    {/*112,*/ 1175U, -84 ,992U,1263U},
	
    {/*114,*/ 1178U, -85 ,991U,1271U},
    {/*116,*/ 1181U, -86 ,990U,1278U},
    {/*118,*/ 1185U, -88 ,990U,1286U},
    {/*120,*/ 1188U, -91 ,989U,1294U},
    
};


TempParams_t const * LP_GetTempTableRed(LedNum_t ledIndex)
{
    return TEMP_CURVE_TABLE_RED;
}

TempParams_t const * LP_GetTempTableGreen(LedNum_t ledIndex)
{
    return TEMP_CURVE_TABLE_GREEN;
}

TempParams_t const * LP_GetTempTableBlue(LedNum_t ledIndex)
{
    return TEMP_CURVE_TABLE_BLUE;
}




